﻿using King.Box.Models.Db.Basic;
using King.Box.Service;
using King.Box.Utils.Global;
using King.Box.WebApi.Providers.Impl;
using PsCat.Aspet;
using System.Collections.Generic;
using System.Web.Http;

namespace King.Box.WebApi.Controllers
{
#if !DEBUG
    [ClientAuthorize]
#endif
    [RoutePrefix("api/basic")]
    public class BasicController : ApiController
    {
        private readonly IBasicService _basicService;

        public BasicController(IBasicService basicService)
        {
            _basicService = basicService;
        }

        #region Dictionary
        [HttpGet]
        [UrlCat]
        [Route("dictionary/{flag}")]
        public Basic_Dictionary GetDictionary(string flag)
        {
            return _basicService.GetDictionary(flag);
        }

        [HttpGet]
        [UrlCat]
        [Route("dictionary/{flag}/value")]
        public string GetDictionaryValue(string flag)
        {
            return _basicService.GetDictionaryValue(flag);
        }
        #endregion
    }
}
